home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
parsed
/
mdelim.frm
< prev
next >
Wrap
Text File
|
1995-05-02
|
8KB
|
284 lines
VERSION 2.00
Begin Form frmMultiDelim
Caption = "Parse Demo - Parse Test With Multiple Character Delimiter"
ClientHeight = 4605
ClientLeft = 915
ClientTop = 1200
ClientWidth = 8130
Height = 5010
Left = 855
LinkTopic = "Form1"
ScaleHeight = 4605
ScaleWidth = 8130
Top = 855
Width = 8250
Begin CommandButton cmdSwitch
Caption = "&Switch"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Left = 6960
TabIndex = 21
Top = 105
Width = 975
End
Begin CommandButton cmdClear
Caption = "&Clear"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 285
Left = 7515
TabIndex = 18
Top = 1020
Width = 555
End
Begin CommandButton cmdLoadEx
Caption = "&Load Example"
Height = 330
Left = 195
TabIndex = 17
Top = 1500
Width = 3090
End
Begin TextBox txtFullString
Height = 285
Left = 1200
TabIndex = 3
Tag = "txtFullString"
Top = 1035
Width = 6270
End
Begin TextBox txtDelim
Height = 285
Left = 1200
TabIndex = 1
Top = 630
Width = 1095
End
Begin CommandButton cmdParse
Caption = "&Parse"
Height = 330
Left = 3615
TabIndex = 4
Top = 1500
Width = 3750
End
Begin Label lblCurRoutine
FontBold = -1 'True
FontItalic = -1 'True
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 405
Left = 2610
TabIndex = 20
Top = 120
Width = 4185
End
Begin Label Label3
Caption = "Current Routine:"
Height = 270
Left = 240
TabIndex = 19
Top = 120
Width = 2235
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 11
Left = 4155
TabIndex = 16
Top = 3990
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 10
Left = 4155
TabIndex = 15
Top = 3615
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 9
Left = 4155
TabIndex = 14
Top = 3240
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 8
Left = 4155
TabIndex = 13
Top = 2850
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 7
Left = 4155
TabIndex = 12
Top = 2460
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 6
Left = 4155
TabIndex = 11
Top = 2100
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 5
Left = 855
TabIndex = 9
Top = 3990
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 4
Left = 855
TabIndex = 10
Top = 3615
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 3
Left = 855
TabIndex = 8
Top = 3225
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 2
Left = 855
TabIndex = 7
Top = 2835
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 1
Left = 855
TabIndex = 6
Top = 2460
Width = 3000
End
Begin Label lblString
BorderStyle = 1 'Fixed Single
Height = 270
Index = 0
Left = 855
TabIndex = 5
Top = 2100
Width = 3000
End
Begin Label Label2
Caption = "&Full String:"
Height = 255
Left = 210
TabIndex = 2
Top = 1050
Width = 930
End
Begin Label Label1
Caption = "&Delimiter:"
Height = 255
Left = 210
TabIndex = 0
Top = 630
Width = 900
End
End
Sub cmdClear_Click ()
txtFullString = ""
txtFullString.SetFocus
End Sub
Sub cmdLoadEx_Click ()
txtDelim = "|delim|"
txtFullString = "This|delim|is|delim|a test of|delim|ParseAndFillArray|delim|routine."
cmdParse.SetFocus
End Sub
Sub cmdParse_Click ()
Dim numelements%, i%
Dim TheString$, Delim$
Dim DynArray$()
Screen.MousePointer = HOURGLASS
'clear out labels
For i% = 0 To 11
lblString(i%) = ""
Next i%
'allow them to clear
DoEvents
TheString$ = txtFullString
Delim$ = txtDelim
'call the appropriate function
If lblCurRoutine = "ParseAndFillArray1%()" Then
numelements% = ParseAndFillArray1%(TheString$, Delim$, DynArray$())
Else
numelements% = ParseAndFillArray2%(TheString$, Delim$, DynArray$(), 10)
End If
'set max of 12 string parts for sake of example
If numelements% > 12 Then
numelements% = 12
End If
'put elements into labels
For i% = 1 To numelements%
lblString(i% - 1) = DynArray$(i%)
Next i%
Screen.MousePointer = HOURGLASS
End Sub
Sub cmdSwitch_Click ()
'toggle to other available routine
If lblCurRoutine = "ParseAndFillArray1%()" Then
lblCurRoutine = "ParseAndFillArray2%()"
Else
lblCurRoutine = "ParseAndFillArray1%()"
End If
End Sub
Sub Form_Activate ()
Screen.MousePointer = DEFAULT
End Sub
Sub Form_Unload (Cancel As Integer)
End
End Sub